package org.pettyfox.pfpay.msg;

import com.alibaba.fastjson.JSON;
import org.pettyfox.pfpay.utils.BeanMapUtil;

import java.util.Map;

/**
 * Created by ace on 2017/8/23.
 */
public class BaseResponse {
    private int status = 200;
    private String message;
    /**
     * 状态码的表述
     */
    private String code;
    public BaseResponse(int status, String message) {
        this.status = status;
        this.message = message;
    }


    public BaseResponse() {
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }
    public Map<String,Object> toMap(){
        return BeanMapUtil.objectToMap(this);
    }

    @Override
    public String toString(){
        return JSON.toJSONString(this);
    }
}
